// 仪表盘相关API - 纯前端模拟数据

// 模拟API响应
const mockApiResponse = (data, delay = 300) => {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve({ data });
    }, delay);
  });
};

// 获取仪表盘数据
export const getDashboardData = async () => {
  return mockApiResponse({
    success: true,
    data: {
      totalMembers: 25,
      activeMembers: 22,
      totalEvents: 12,
      upcomingEvents: 3,
      totalSongs: 45,
      totalRehearsals: 156,
      monthlyCheckins: 89,
      checkinRate: 85,
      recentActivities: [
        { id: 1, type: 'checkin', user: '张三', action: '完成每日打卡', time: '09:05' },
        { id: 2, type: 'rehearsal', user: '李四', action: '创建排练记录', time: '14:30' },
        { id: 3, type: 'event', user: '王五', action: '报名周末演出', time: '16:20' },
      ],
      chartData: {
        checkins: [65, 72, 68, 74, 81, 79, 85],
        rehearsals: [12, 15, 13, 18, 16, 20, 17],
        events: [2, 3, 1, 4, 2, 3, 2],
      },
    },
  });
};

// 获取统计数据
export const getStats = async () => {
  return mockApiResponse({
    success: true,
    data: {
      memberStats: {
        total: 25,
        active: 22,
        inactive: 3,
        newThisMonth: 2,
      },
      eventStats: {
        total: 12,
        upcoming: 3,
        completed: 9,
        thisMonth: 2,
      },
      rehearsalStats: {
        total: 156,
        thisMonth: 18,
        averageDuration: 2.5,
        attendanceRate: 85,
 